package lz.com.demo;



import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lz.com.domain.Tblconsumer;
import lz.com.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(value = "数据库测试")
public class Demo2 {

    @Autowired
    private ConsumerService consumerService;

    @RequestMapping(value = "/select",method = RequestMethod.POST)
    @ApiOperation(value="查询所有", notes="无注意事项")
    public List<Tblconsumer> select(){
        return consumerService.findJustList();
    }

    @RequestMapping(value = "/selectOne",method = RequestMethod.GET)
    @ApiOperation(value="按id查询", notes="test: 1",response = Tblconsumer.class)
    @ApiImplicitParam(name = "id", value = "客户id",required=true, dataType = "int",paramType = "query")
    public Tblconsumer selectOne( Integer id){
        return consumerService.findJust(id);
    }
}
